<!doctype html>
<html><!-- InstanceBegin template="/Templates/cloud.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=640, initial-scale=0.5, minimum-scale=0.5, maximum-scale=0.5">
<!-- InstanceBeginEditable name="doctitle" -->
<title>智能云管家-应用推荐</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="EditRegion-jscode" -->
<script src="resources/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="resources/js/common.js"></script>

<script type="text/javascript">
$(function(){
    addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); 
	addEventListener("orientationchange", function() { setTimeout(hideURLbar, 0); }, false);
	addEventListener("load",function(){$("#loading").hide();
	$(".floatBoxBg").hide();});
      function hideURLbar(){ 
               window.scrollTo(0,1); 
      }
      if(navigator.userAgent.toLowerCase().indexOf("android", 0)<0){
         $("#footer").css({"center;z-index":"999","position":"fixed","bottom":"0"});
         window.scrollTo(0,1); 
        }else{
        $("#footer").css({"position":"fixed","bottom":"0"});
    var top = $("#footer").offset().top;
    $(window).scroll(function(){
    $("#footer").offset({top:$(document).scrollTop()+top});
    });
        }

       }); 

$(document).ready(function() {

	logincheck();
	$("#appDlAd").hide();
	$("#appDlAp").hide();
	$("#app_det2").hide();
	$("body").attr("onresize","overhidden()");
	var url=jsonserver+"app/relation/appid/"+getQueryParameter("app_id")+"/limit/3";
	$.getJSON(url+".jsonp?callback=?",{},function(data){
		if(detectDeviceType()=="Android"){
			$("#appDlAd").show();
		errorcheck(data.sb.status,data.sb.msg);
		$("#appNm").text(data.app_name);
		$("#size").text(data.app_mb);
		$("#dlHistory").text(data.app_downcount);
		$("#edition").text(data.version_num);
		$("#appPic").attr("src",data.logo_url);
		$("#free").text(data.is_limitfree);
		$("#app_det").text(data.app_desc);
		$("#app_det2").text(data.app_desc);
		$("#dlBtn").attr("href",data.download_url);

		}else{
			$("#appDlAp").show();
			errorcheck(data.sb.status,data.sb.msg);
		$("#appNmAp").text(data.app_name);
		$("#appPicAp").attr("src",data.logo_url);
		$("#freeAp").text(data.is_limitfree);
		$("#app_det").text(data.app_desc);
		$("#app_det2").text(data.app_desc);
		$("#dlBtnAp").bind("click",function(){
			window.open(data.download_url);
			});
		$("#sizeAp").text(data.app_mb);	
		$("#source").text(data.app_firm);
		$("#releasedate").text(data.update_date);
		$("#editionAp").text(data.version_num);
		}
		$.each(data.sameAppList,function(i,field){
				$("#app_reco").append('<div style="height: 83px; background-image: url(resources/css/images/mybusiness/images/list_bg.png); font-size: 32px;" onclick="goto('+field.app_id+')"><table width="100%" height="83px" border="0"><tr><td width="14%"><img id='+field.app_id+"_pic"+' src='+field.logo_url+' width="61px" height="61px" /></td><td width="72%"><div class="overhide">'+field.app_name+'</div></td><td width="14%"><img src="resources/css/images/Recommend/images/tj_turn.png"/></td></tr></table></div>');
			});
			
	overhidden();
		});
	if(localStorage.getItem("width")==null){
		localStorage.setItem("width",window.screen.width);
		localStorage.setItem("height",window.screen.height);
	}
	if(localStorage.getItem("width")>700) {
		$("meta").attr("content","width=device-width, initial-scale=0.6, minimum-scale=0.6, maximum-scale=0.6");
	}
	if(window.screen.height>window.screen.width){
		Vertical();
	}
	$( window ).bind( "orientationchange", function() {
		changeScreen();
		});
});
function changeScreen(){
	if(window.screen.height>window.screen.width){
		Vertical();
		} 
	else {
		$("#content").removeAttr("style");
		$("#mainconfig").removeAttr("style");
	}
	}
function Vertical(){
	var screenheigh = localStorage.getItem("height");
	if(screenheigh<=500){
		$("#mainconfig").get(0).style.height="650px";
	}
	else if(screenheigh>1100){
		$("#content").get(0).style.height=screenheigh+"px";
		$("#mainconfig").get(0).style.height=0.8*screenheigh+"px";
	}
	else{
		$("#content").get(0).style.height=1.4*screenheigh+"px";
		$("#mainconfig").get(0).style.height=1.17*screenheigh+"px";
	}
	}
function uporDown(){
	if($("#updownFlag").val()=="0"){
			
			$("#app_det").animate({height:$("#app_det2").height()});
			$("#openFlag").attr("src","resources/css/images/Recommend/images/tj_up.png");
			$("#updownFlag").val("1");
			$("#app_det2").click();
		}else{
			$("#app_det").animate({height:"200px"});
			
			$("#openFlag").attr("src","resources/css/images/Recommend/images/tj_down.png");
			$("#updownFlag").val("0");
			$("#app_det").click();
			}
	}
function goto(appId){
	window.location.href="app-recommon.html?app_id="+appId;
}
function getQueryParameter(qs)  
	{  
		var s = location.href;  
		s = s.replace("?","?&").split("&");//这样可以保证第一个参数也能分出来 
		var re = "";  
		for(i=1;i<s.length;i++)  
			if(s[i].indexOf(qs+"=")==0)  
				re = s[i].replace(qs+"=","");//取代前面的参数名，只剩下参数值  
				  
		return re;  
	}  
function overhidden(){
	var w=document.body.clientWidth;
	$(".overhide").attr("style","width:"+(0.7*w)+"px");
}
function detectDeviceType(){
	var isIphone =navigator.userAgent.indexOf("iPhone") != -1;
	var isIpod = navigator.userAgent.indexOf("iPod") != -1 ;
	var isIpad = navigator.userAgent.indexOf("iPad") != -1 ;
	
	var isAndroid = navigator.userAgent.indexOf("Android") != -1 ;
	var isIos = isIphone || isIpod || isIpad ;
	return isIos?"Apple":"Android";

} 

</script>
<style type="text/css">
.overflow {
	overflow:hidden;
	text-overflow:ellipsis;
	height:200px;
}
.overhide{
	overflow:hidden;
	text-overflow:ellipsis;
	white-space:nowrap;
	-o-text-overflow:ellipsis;}

</style>
<link href="resources/css/load.css" rel="stylesheet" type="text/css">
<!-- InstanceEndEditable -->
<style type="text/css">
*{
	font-family:Heiti SC;
}
</style>
	<script type="text/javascript">
//var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
//document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F2284c04845acdcd94dd640a8555927dc' type='text/javascript'%3E%3C/script%3E"));
</script>
</head>

<body style="margin:0;">

	<div id="header">
	<!-- InstanceBeginEditable name="EditRegion-header" -->
   <div style="width:100%; background-image:url('resources/css/images/top_bg.jpg'); height:88px"><table width="100%" height="88px" border="0">
  <tr>
    <td style="width:18%; max-width:110px; padding-left:5px"><img src="resources/css/images/warning/images/fanhui.png" width="90%" style="max-width:99px" onClick="javascript:window.location.href='index.html'"/></td>
    <td style="text-align: center; font-size: 40px;">应用推荐</td>
    <td width="18%" style="max-width:max-width:110px; padding-right:5px">&nbsp;</td>
  </tr>
</table>

    </div>
	<!-- InstanceEndEditable -->
    </div>
    <div id="content">
    <div id="loading" class="loading"><img src="resources/css/images/loading.gif"/>载入中...</div>
    <div class="floatBoxBg"></div>
	<!-- InstanceBeginEditable name="EditRegion-content" -->
    <div id="mainconfig">
    <div id="app">
    <div id="appDlAd" style="height:auto; font-size: 24px;">
    <table width="100%" height="203px" border="0">
  <tr>
    <td rowspan="2" width="32%" style="text-align:center"><img id="appPic" width="175px" height="182px"/></td>
    <td rowspan="2" width="42%">
    <p id="appNm" style="font-size:30px; margin:0px">&nbsp;</p>
    <p>大小：<span id="size"></span></p>
    <p>下载：<span id="dlHistory"></span>次</p>
    <p>版本：<span id="edition"></span></p>
    </td>
    <td><p id="free" style="color:#f35922; text-align:center"></p>
    <p style="text-align:center">来源：木蚂蚁</p>
    </td>
  </tr>
  <tr height="75px">
    <td style="text-align:center"><a  id="dlBtn" ><img src="resources/css/images/Recommend/images/tj_download.png" /></a></td>
  </tr>
</table>

    </div>
    <div id="appDlAp" style="height:auto; font-size: 24px;">
    <table width="100%" height="203px" border="0">
  <tr>
    <td rowspan="2" width="32%" style="text-align:center"><img id="appPicAp" width="175px" height="182px"/></td>
    <td rowspan="2" width="42%">
    <p id="appNmAp" style="font-size:30px; margin:0px">&nbsp;</p>
    <p>大小：<span id="sizeAp"></span></p>
    <p>更新日期：<span id="releasedate"></span></p>
    <p>版本：<span id="editionAp"></span></p>
    </td>
    <td><p id="freeAp" style="color:#f35922; text-align:center"></p>
    <p style="text-align:center">来源：iTunes</p>
    </td>
  </tr>
  <tr height="75px">
    <td style="text-align:center"><img id="dlBtnAp" src="resources/css/images/Recommend/images/tj_download.png"/></td>
  </tr>
</table>

    </div>
    <div style="width:100%; height:1px; background-color:#CCC"></div>
    <div id="appInfo" style="padding-right: 20px; padding-bottom: 10px; font-size: 32px; height:auto">
    <div style="padding-left:10px; line-height:50px">官方介绍：</div>
    <div id="app_det" style="padding-left: 20px; font-size: 26px; line-height:33px; width:100%;" class="overflow"> </div>
    <div id="app_det2" style="padding-left: 20px; font-size: 26px; line-height:33px; width:100%;"> </div>
    </div>
    </div>
    <div id="openBtn" align="center" onClick="uporDown()"><img id="openFlag" src="resources/css/images/Recommend/images/tj_down.png"/><input id="updownFlag" type="hidden" value="0"/></div>
    <div style="height:1px; width:100%; background-color:#CCC"></div>
    <div id="appReco">
    <div style="margin-bottom: 10px; margin-top: 20px; font-size: 32px;">喜欢该游戏的人还喜欢：</div>
    <div id="app_reco"></div>
    </div>
    </div>
   
	<!-- InstanceEndEditable -->
    </div>
    <!-- InstanceBeginEditable name="EditRegion-footer" --><!-- InstanceEndEditable -->
    <div id="footer">
    </div>
    
</body>
<!-- InstanceEnd --></html>
